import re
headers_str = """
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7
Cache-Control: no-cache
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Cookie: ASP.NET_SessionId=rpo4t2z5hiovl0f1atcdwmng
Host: data.gdcic.net
Origin: https://data.gdcic.net
Pragma: no-cache
Referer: https://data.gdcic.net/Dop/Search/ApplyOpenList.aspx
sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"
sec-ch-ua-mobile: ?0
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
"""

for line in headers_str.splitlines():
	# \1和\2用来匹配分组的内容
    print(re.sub('^(.*?): (.*)$',r"'\1': '\2',",line))

